/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.ing.sisval.bl;

import java.util.ArrayList;
import org.ing.sisval.be.BEContenedorComplementario;
import org.ing.sisval.da.DAContenedorComplementario;
import org.ing.sisval.ds.DSUtil;
import org.rx.cr.bl.BLAbstract;
import org.rx.cr.conf.Config;

/**
 *
 * @author Mysham
 */
public class BLContenedorComplementario extends BLAbstract<BEContenedorComplementario> {

    DAContenedorComplementario dao;

    public BLContenedorComplementario(Config c) {
        setDSConeccion(DSUtil._DSConneccion(c));
    }

    @Override
    public int registrar(BEContenedorComplementario tipo) throws Exception {
        dao = new DAContenedorComplementario(getConeccion());
        return dao.registrar(tipo);
    }

    @Override
    public int actualizarRegistro(BEContenedorComplementario tipo) throws Exception {
        dao = new DAContenedorComplementario(getConeccion());
        return dao.actualizarRegistro(tipo);
    }

    @Override
    public int eliminarRegistro(BEContenedorComplementario tipo) throws Exception {
        dao = new DAContenedorComplementario(getConeccion());
        return dao.eliminarRegistro(tipo);
    }

    @Override
    public ArrayList<BEContenedorComplementario> buscarReferencia(String string) throws Exception {
        dao = new DAContenedorComplementario(getConeccion());
        return dao.buscarReferencia(string);
    }

    @Override
    public ArrayList<BEContenedorComplementario> listar() throws Exception {
        dao = new DAContenedorComplementario(getConeccion());
        return dao.listar();
    }

    @Override
    public BEContenedorComplementario buscar(int i) throws Exception {
        dao = new DAContenedorComplementario(getConeccion());
        return dao.buscar(i);
    }

    public ArrayList<BEContenedorComplementario> listarAsignacion(int idvc) {
        dao = new DAContenedorComplementario(getConeccion());
        return dao.listarAsignacion(idvc);
    }
  public int eliminarAsignacion(int infraestructucturaId) throws Exception {
        dao = new DAContenedorComplementario(getConeccion());
        return dao.eliminarAsignacion(infraestructucturaId);
    }

}
